package com.course.chapter7;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;

public class ScheduledThreadPoolDemo {
    public static void main(String[] args) {
        ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(5);
        for (int i = 0; i < 20; i++) {
            scheduledExecutorService.execute(new RunnableDemo());
        }
        scheduledExecutorService.shutdown();
    }
}
